<?php
namespace App\Traits;

use App\Models\FakeList;

Trait Trait64_75 {

    public function electricityUsage()
    {
        $usage = [
            '顶楼' => random_int(100,200),
            '8楼' => random_int(100,200),
            '7楼' => random_int(100,200),
            '6楼' => random_int(100,200),
            '5楼' => random_int(100,200),
            '4楼' => random_int(100,200),
            '3楼' => random_int(100,200),
            '2楼' => random_int(100,200),
            '1楼' => random_int(100,200),
            '-1楼' => random_int(100,200),
            '-2楼' => random_int(100,200),
        ];
        $useElectricity = [
            'today' => random_int(1,100),
            'yesterday' => random_int(1,100),
        ];
        $useWater = [
            'today' => random_int(1,100),
            'yesterday' => random_int(1,100),
        ];
        $responseJson = [
            'code' => 200,
            'message' => '',
            'data' => [
                'usage' => $usage,
                'useElectricity' => $useElectricity,
                '$useWater' => $useWater
            ]
        ];
        return response()->json($responseJson);
    }

}
